package day06.YiChang;

import java.util.Scanner;

public class Lian02 {
    public static void main(String[] args) {
//        method();

        try {
            Scanner sc = new Scanner(System.in);
            System.out.println("请输入您的年龄");
            String s = sc.nextLine();
            int age = Integer.parseInt(s);
            System.out.println(age);
            System.out.println(2 / 0);
            System.out.println("执行456");
        } catch (Exception e) {

        }
        System.out.println("测试");

//        private static void method(){
            try {
                Scanner sc = new Scanner(System.in);
                System.out.println("请输入您的年龄");
                String s = sc.nextLine();
                int age = Integer.parseInt(s);
                System.out.println(age);
                System.out.println(2 / 0);
                System.out.println("执行456");
            } catch (NumberFormatException e) {
                System.out.println("格式化出现异常");
            } catch (ArithmeticException e) {
                System.out.println("数学运算出现异常");
            }
            System.out.println("执行123");
        }
    }
//}
